﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Snake.Core;
using Snake.Mapping;

namespace Snake.SQL.SQLNode
{
    public class From : ISQLNode
    {
        private readonly DbOperate _dbOperate;

        public From(DbOperate operate)
        {
            _dbOperate = operate;
        }

        public void Render(SQLWriter writer)
        {
            writer.AppendLine(SQLStrings.From, _dbOperate.EntityMap.Schema + _dbOperate.EntityMap.Table, SQLStrings.As, _dbOperate.Alias, SQLStrings.NoLock);
        }
    }
}
